package com.example.flying_personnel_management_system.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration  //关于webmvc自定义的配置
class MyMvcConfig implements WebMvcConfigurer {

    //用于控制所有视图的控制器(本质就是为了代替以前的DispatcherServlet)
    public void addViewControllers(ViewControllerRegistry registry) {

    }

    //配置拦截器要拦截的部分和不拦截的部分
 /*   public void addInterceptors(InterceptorRegistry registry) {
        //添加拦截器并且匹配拦截的所有请求
        registry.addInterceptor(new hand()).addPathPatterns("/**")
                .excludePathPatterns("/","/index.html","/index","/css/**","/js/**","/img/**");
    }
*/
}
